<?php	
if(Phpfox::getUserParam('tnskype.can_have_skype_account')){
	$skype = array();		
	$skype = $this->get('val');
	$phrase_add_skype_error = Phpfox::getPhrase('tnskype.please_provide_valid_skype_account');
	if (preg_match('/^[a-z][a-z0-9\.,\-_]{5,31}$/i', $skype['skype_account'])) {
		
				Phpfox::getService('tnskype')->addSkype(Phpfox::getUserId(),$skype['skype_account'],$skype['skype_active']);

	}
	else{
		if($skype['skype_account'] != ''){
			Phpfox_Error::set($phrase_add_skype_error);
		}
		else{
			Phpfox::getService('tnskype')->addSkype(Phpfox::getUserId(),$skype['skype_account'],$skype['skype_active']);
		}
	}
}
?>